<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="static/js/axios.min.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="static/css/index.css">
    <script src="static/js/vue@2.6.14.js"></script>
    <!-- 引入组件库 -->
    <script src="static/js/index.js"></script>
    <title>主页</title>
</head>
<body>
    <div class="out-ct">
             <h1 style="text-align: center">{{ msg }}</h1>
 <div style="width: 400px;margin: 0 auto;text-align: center" id="app">
     <el-upload
  class="upload-demo"
  drag
  :on-success="upSuccess"
  :on-error="upError"
  accept=".png,.jpg,.jpeg"
  action="uploadFile"
  multiple>
  <i class="el-icon-upload"></i>
  <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
  <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
</el-upload>

{#     <el-button type="primary" @click="test">测试</el-button>#}


 </div>
    </div>

</body>
<style>
    .out-ct{
        width: 400px;
        margin: 0 auto;
    }
</style>
 <script>
    new Vue({
      el: '#app',
      data: {
        visible: false
      },
        methods:{
          upSuccess(response, file, fileList){
                this.$message.success('操作成功');
          },
          upError(response, file, fileList){
              this.$message.error('操作失败');
          },
          test(){
              console.log('1231')
              axios.post('/test', {
                  })
                  .then(function (response) {
                    console.log(response);
                  })
                  .catch(function (error) {
                    console.log(error);
                  });
          }
        }
    })
  </script>
</html>